//将策略类封装在对象中
var strategy = {
    "S" : function(salary){
        return salary*4
    },
    "A" : function(salary){
        return salary*3
    },
    "B" : function(salary){
        return salary*2
    }
}
//计算奖金
var calculateBouns = function (salary,level){
    return strategy[level](salary);
}
//测试
console.log(calculateBouns(4000,"S"));
console.log(calculateBouns(3000,"S"));

